<!doctype html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
</head>
<body>
	<div></div>
	<button>添加</button>
	<button>删除</button>
	<script>
		var an = document.getElementsByTagName('button')[0];

			an.onclick = function() {
				var div = document.getElementsByTagName('div')[0];
				var span = document.createElement('span');
				var txt = document.createTextNode('hlloe word ');
				div.appendChild(span);
				span.appendChild(txt);
			};
		
		
		var an1 = document.getElementsByTagName('button')[1];
		
			an1.onclick = function() {
				var div = document.getElementsByTagName('div')[0];
				var span = document.getElementsByTagName('span')[0];
				div.removeChild(span);
				if(span.length<0){
					an.disabled = disabled;
				};
		};

	</script>
</body>
</html>